home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Demos / Bowers Development / AppMaker 2.0b5 / Examples / ODF / AMSample / Sources / Commands.h < prev    next >
Encoding:
Text File  |  1996-06-03  |  4.3 KB  |  159 lines  |  [TEXT/CWIE]

  1. //========================================================================================
  2. //
  3. //    File:                Commands.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef COMMANDS_H
  11. #define COMMANDS_H
  12.  
  13. // ----- Framework Includes -----
  14.  
  15. #ifndef FWCLPCMD_H
  16. #include "FWClpCmd.h"
  17. #endif
  18.  
  19. #ifndef FWDRCMD_H
  20. #include "FWDrCmd.h"
  21. #endif
  22.  
  23. #ifndef FWBNDSTR_H
  24. #include "FWBndStr.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. // Forward Declarations
  29. //========================================================================================
  30.  
  31. class CAMSampleContent;
  32.  
  33. //========================================================================================
  34. // CAMSampleEditCommand
  35. //========================================================================================
  36.  
  37. class CAMSampleEditCommand : public FW_CClipboardCommand
  38. {
  39. //----------------------------------------------------------------------------------------
  40. //    Initialization/Destruction
  41. //
  42. public:
  43.  
  44.     FW_DECLARE_AUTO(CAMSampleEditCommand)
  45.  
  46.     CAMSampleEditCommand(Environment* ev,
  47.                       ODCommandID id,
  48.                       CAMSampleContent* itsContent,
  49.                       FW_CFrame* frame);
  50.  
  51.     virtual ~CAMSampleEditCommand();
  52.  
  53. //----------------------------------------------------------------------------------------
  54. //    Inherited API
  55. //
  56. public:
  57.     virtual void        UndoIt(Environment *ev);
  58.     virtual void        RedoIt(Environment *ev);
  59.     virtual void        SaveUndoState(Environment *ev);
  60.  
  61. //----------------------------------------------------------------------------------------
  62. //    New API
  63. //
  64. private:
  65.     void                RemoveSelection(Environment* ev);
  66.     void                RestoreSelection(Environment* ev);
  67.     void                SwapSelection(Environment* ev);
  68.  
  69. //----------------------------------------------------------------------------------------
  70. //    Data Members
  71. //
  72. private:
  73.     CAMSampleContent*        fAMSampleContent;
  74.     FW_CString255        fSavedTextData;        // Saved data for undo/redo
  75. };
  76.  
  77.  
  78.  
  79. //========================================================================================
  80. //    class CAMSampleDragCommand
  81. //========================================================================================
  82.  
  83. class CAMSampleDragCommand : public FW_CDragCommand
  84. {
  85. //----------------------------------------------------------------------------------------
  86. //    Initialization/Destruction
  87. //
  88. public:
  89.  
  90.     FW_DECLARE_AUTO(CAMSampleDragCommand)
  91.  
  92.     CAMSampleDragCommand(Environment* ev,
  93.                       CAMSampleContent* content,
  94.                       FW_CFrame* frame);
  95.     virtual ~CAMSampleDragCommand();
  96.  
  97. //----------------------------------------------------------------------------------------
  98. //    Inherited API
  99. //
  100. public:
  101.     virtual void        UndoIt(Environment *ev);
  102.     virtual void        RedoIt(Environment *ev);
  103.     virtual void        SaveUndoState(Environment *ev);
  104.  
  105. //----------------------------------------------------------------------------------------
  106. //    Data Members
  107. //
  108. private:
  109.     CAMSampleContent*        fAMSampleContent;
  110.     FW_CString255        fSavedTextData;        // Saved data for undo/redo
  111. };
  112.  
  113. //========================================================================================
  114. //    class CAMSampleDropCommand
  115. //========================================================================================
  116.  
  117. class CAMSampleDropCommand : public FW_CDropCommand
  118. {
  119. //----------------------------------------------------------------------------------------
  120. //    Initialization/Destruction
  121. //
  122. public:
  123.  
  124.     FW_DECLARE_AUTO(CAMSampleDropCommand)
  125.  
  126.     CAMSampleDropCommand(Environment *ev,
  127.                       CAMSampleContent* content,
  128.                       FW_CFrame* frame,
  129.                       ODDragItemIterator* dropInfo, 
  130.                       ODFacet* odFacet,
  131.                       const FW_CPoint& dropPoint);
  132.  
  133.     virtual ~CAMSampleDropCommand();
  134.  
  135. //----------------------------------------------------------------------------------------
  136. //    Inherited API
  137. //
  138. public:
  139.     virtual void        UndoIt(Environment *ev);
  140.     virtual void        RedoIt(Environment *ev);
  141.     virtual void        SaveUndoState(Environment *ev);
  142.  
  143. //----------------------------------------------------------------------------------------
  144. //    New API
  145. //
  146. private:
  147.     void SwapSelection(Environment* ev);
  148.  
  149. //----------------------------------------------------------------------------------------
  150. //    Data Members
  151. //
  152. private:
  153.     CAMSampleContent*        fAMSampleContent;
  154.     FW_CString255        fSavedTextData;        // Saved data for undo/redo
  155. };
  156.  
  157.  
  158. #endif
  159.